package com.nd.controller.wx;

import com.nd.pojo.bo.wx.FootprintDeleteBo;
import com.nd.pojo.vo.wx.BaseRespWXVo;
import com.nd.pojo.vo.wx.FootprintDataVo;
import com.nd.service.wx.FootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/footprint")
public class FootprintController {

    @Autowired
    FootprintService footprintService;

    @RequestMapping("list")
    public BaseRespWXVo list(Integer page, Integer size){

        FootprintDataVo footprintDataVo = footprintService.list(page, size);

        return BaseRespWXVo.ok(footprintDataVo);



    }

    @RequestMapping("delete")
    public BaseRespWXVo delete(@RequestBody FootprintDeleteBo footprintDeleteBo){

        Integer code = footprintService.delete(footprintDeleteBo.getId());

        if (code != 0){
            return BaseRespWXVo.fail();
        }


        return BaseRespWXVo.ok();
    }





}
